<template>
	<PageContainer name="个人信息">
		<AvatarForm />
	</PageContainer>
</template>

<script>
	import PageContainer from '@/components/PageContainer/PageContainer.vue';
	import AvatarForm from './components/Edit/AvatarForm.vue';
	import {
		updateUserProfile
	} from '@/api/system/user.js';
	export default {
		components: {
			PageContainer,
			AvatarForm
		},
		data() {
			return {
				formData: {},
			}
		},
		methods: {
			async updateUserProfile(params, done) {
				const result = await updateUserProfile(params)
				uni.showToast({
					icon: 'none',
					title: '已修改'
				})
				this.$store.dispatch('GetInfo').then();
				done();
			}
		},
		onLoad() {
			const {
				user
			} = this.$store.state;
			this.formData = user;
		}
	}
</script>

<style>

</style>